package com.foreveredu.furedusys.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 领域模型类：试卷
 * 
 * @author hushigang
 * 
 */
@Entity
@Table(name = "paper")
public class Paper implements Serializable {

	private static final long serialVersionUID = 6184380794116907242L;
	private int id;
	private Exam exam;// 属于哪次考试
	private Question question;// 试卷包含哪些题目
	private String userAnswer;// 用户答案
	private int score;// 每题得分

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name = "exam_id")
	public Exam getExam() {
		return exam;
	}

	public void setExam(Exam exam) {
		this.exam = exam;
	}

	@ManyToOne
	@JoinColumn(name = "question_id")
	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	@Column
	public String getUserAnswer() {
		return userAnswer;
	}

	public void setUserAnswer(String userAnswer) {
		this.userAnswer = userAnswer;
	}

	@Column
	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

}
